//
//  ClientProdutModel.m
//  BCVersion
//
//  Created by 吴 崧 on 14-2-24.
//  Copyright (c) 2014年 Jungle. All rights reserved.
//

#import "ClientProdutModel.h"

@implementation ClientProdutModel

-(instancetype)initWithDataSource:(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dic];
        
    }
    return self;
}

+(NSArray *)modelsWithDataSource:(NSArray *)dataSource
{
    __block NSMutableArray * result = [[NSMutableArray alloc]initWithCapacity:dataSource.count];
    [dataSource enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        __weak NSDictionary *infoDic = (NSDictionary *)obj;
        ClientProdutModel *pt = [[ClientProdutModel alloc]initWithDataSource:[infoDic copy]];
        [result addObject:pt];
    }];
    
    __autoreleasing NSArray *finalArray = [[NSArray alloc]initWithArray:result];
    result = nil;
    dataSource = nil;
    return finalArray;
}


@end
